AppChooserDialog: Fix memleak
authorRico Tzschichholz <ricotz@ubuntu.com>
Wed, 18 Feb 2015 10:38:29 +0000 (11:38 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Wed, 18 Feb 2015 10:38:29 +0000 (11:38 +0100)
gtk/gtkappchooserdialog.c

index 485149f249c3887f663cc50d2da0feb6519b5216..204b415607731d1c2178790914623147ca493c3e 100644 (file)
@@ -460,10 +460,15 @@ software_button_clicked_cb (GtkButton           *button,
 static void
 ensure_software_button (GtkAppChooserDialog *self)
 {
-  if (g_find_program_in_path ("gnome-software"))
+  gchar *path;
+
+  path = g_find_program_in_path ("gnome-software");
+  if (path != NULL)
     gtk_widget_show (self->priv->software_button);
   else
     gtk_widget_hide (self->priv->software_button);
+
+  g_free (path);
 }
 
 static void